<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
       * {
           margin: 0px;
           padding: 0px;
       }
       p {
           font-size: 10px;
           color: #aaa;
           margin-bottom: 20px;
           text-align: center;
       }
       table, tbody {
           width: 100%;
       }
       .td_image {
           width: 24.5%;
       }
       img {
           width: 100%;
       }
       .red {
           color: red;
       }
       .right {
           color: gray;
           text-align: right;
       }
    </style>
<script src="/static/js/lazyload.js"></script>
<script src='https://code.jquery.com/jquery-3.3.1.min.js'></script>
</head>
<body>
<table>
    <?php foreach ($abnormal_values as $abnormal_value) { $timestamp = strtotime($abnormal_value['at']); ?>
        <tr style="font-size: 20px">
            <td style='width: 20px;'>〇</td>
            <td colspan=1><?=$abnormal_value['at'] ?> <span class="red"><?=$abnormal_value['key'] ?></span></td>
            <td colspan=3 class="right"> <?php if ($abnormal_value['volume_at'] < datetime('-30 minutes')) { echo "庄家可能在";
                foreach (CRAWLER_BANKER_ACTION_MAPS as $k => $v) {
                    $radio_key = $abnormal_value['id'].'_'.$k; ?>
                    <input type="radio" action="<?=$k ?>" abnormal-id="<?=$abnormal_value['id']?>" name="<?=$abnormal_value['id']?>" id="<?=$radio_key?>" <?=($abnormal_value['banker_action'] === $k)?'checked':''?>>
                    <label for="<?=$radio_key?>"><?=$v?></label>
                <?php }} ?>
            </td>
        </tr>
        <tr>
            <td style='width: 20px;'></td>
            <td colspan=4>监控到 <?=$abnormal_value['site']?> 交易所中 <span class="red"><?=$abnormal_value['key']?></span> 5 分钟蜡烛图中在 <span class="red"><?=$abnormal_value['volume_at']?></span> 时有约 <span class="red"><?=round($abnormal_value['volume'], 2)?> BTC</span> 的交易量，是前 25 分钟交易量平均值的  <span class="red"><?=round($abnormal_value['before_avg_volume'] ? $abnormal_value['volume'] / $abnormal_value['before_avg_volume']: 0, 2)?></span> 倍左右</td>
        </tr>
         <tr>
             <td style='width: 20px;'></td>
             <td class="td_image">
                 <img class='lazy' src="/static/loading.png" lazy-src="/static/<?=$abnormal_value['key']?>_<?=$timestamp?>_5m.png" alt="">
                 <p>5 分钟线(图中横跨 5.5 小时)</p>
             </td>
             <td class="td_image">
                 <img class='lazy' src="/static/loading.png" lazy-src="/static/<?=$abnormal_value['key']?>_<?=$timestamp?>_30m.png" alt="">
                 <p>30 分钟线(图中横跨 1.3 天)</p>
             </td>
             <td class="td_image">
                 <img class='lazy' src="/static/loading.png" lazy-src="/static/<?=$abnormal_value['key']?>_<?=$timestamp?>_60m.png" alt="">
                 <p>60 分钟线(图中横跨 2.75 天)</p>
             </td>
             <td class="td_image">
                 <img class='lazy' src="/static/loading.png" lazy-src="/static/<?=$abnormal_value['key']?>_<?=$timestamp?>_1w.png" alt="">
                 <p>1 周线(图中横跨 1.3 年)</p>
             </td>
         </tr>
    <?php } ?>
</table>
<script>

lazy.init({
    offset: 50,
　　throttle: 0
});

function get_cookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return null;
}

$(function () {
    $('input:radio').on('change', function () {
        $this = $(this);
        $.post('/ajax/mark_crawler', {
            action: $this.attr('action'),
            abnormal_id: $this.attr('abnormal-id'),
            account_token: get_cookie('account_token')
        });
    });
});

</script>
</body>
</html>
